package cn.imnaer.service.rest.view.model;

import java.util.ArrayList;
import java.util.List;

import cn.imnaer.service.Interceptor.CommonInterceptor;
import cn.imnaer.service.persistence.model.FriendRelation;
import cn.imnaer.service.persistence.model.TravelNoteComment;
import cn.imnaer.service.persistence.model.TravelNotePhoto;
import cn.imnaer.service.persistence.model.TribalMessage;

public class TravelNotePhotoDetail implements CommonInterceptor {
	private String travelNotePhotoId;
	private String image;
	private String introduction;
	private double score; // 再去意愿，即评分
	private String scenicId;
	private String scenicName;
	private List<String> supportUsers = new ArrayList<>();
	private int commentCount;// 评论是针对单挑数据
	private List<TravelNoteCommentDetail> comments=new ArrayList<TravelNoteCommentDetail>();
    private List<TribalMessage> tribalMessages = new ArrayList<>();
	private int supportCount;
	private boolean  isSupport;
    public boolean getIsSupport() {
		return isSupport;
	}

	public void setIsSupport(boolean isSupport) {
		this.isSupport = isSupport;
	}
	public List<TravelNoteCommentDetail> getComments() {
		return comments;
	}

	public void setComments(List<TravelNoteCommentDetail> comments) {
		this.comments = comments;
	}

	public String getTravelNotePhotoId() {
		return travelNotePhotoId;
	}

	public void setTravelNotePhotoId(String travelNotePhotoId) {
		this.travelNotePhotoId = travelNotePhotoId;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getIntroduction() {
		return introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	public String getScenicId() {
		return scenicId;
	}

	public void setScenicId(String scenicId) {
		this.scenicId = scenicId;
	}

	public String getScenicName() {
		return scenicName;
	}

	public void setScenicName(String scenicName) {
		this.scenicName = scenicName;
	}

	public List<String> getSupportUsers() {
		return supportUsers;
	}

	public void setSupportUsers(List<String> supportUsers) {
		this.supportUsers = supportUsers;
	}

	public int getCommentCount() {
		return commentCount;
	}

	public void setCommentCount(int commentCount) {
		this.commentCount = commentCount;
	}

	public double getScore() {
		return score;
	}

	public void setScore(double score) {
		this.score = score;
	}

	public int getSupportCount() {
		return supportCount;
	}

	public void setSupportCount(int supportCount) {
		this.supportCount = supportCount;
	}
	


	
    public List<TribalMessage> getTribalMessages() {
        return tribalMessages;
    }

    public void setTribalMessages(List<TribalMessage> tribalMessages) {
        this.tribalMessages = tribalMessages;
    }

    public TravelNotePhoto buildTravelNotePhoto() {
		TravelNotePhoto travelNotePhoto = new TravelNotePhoto();
		travelNotePhoto.setImage(this.image);
		travelNotePhoto.setIntroduction(this.introduction);
		travelNotePhoto.setScore(this.score);
		travelNotePhoto.setSupportUsers(this.supportUsers);
		travelNotePhoto.setScenicId(this.scenicId);
		travelNotePhoto.setScenicName(this.scenicName);
	
		return travelNotePhoto;
	}

	public static TravelNotePhotoDetail valueOf(TravelNotePhoto travelNotePhoto) {
		TravelNotePhotoDetail travelNotePhotoDetail = new TravelNotePhotoDetail();
		travelNotePhotoDetail.setImage(travelNotePhoto.getImage());
		travelNotePhotoDetail.setIntroduction(travelNotePhoto.getIntroduction());
		travelNotePhotoDetail.setScore(travelNotePhoto.getScore());
		travelNotePhotoDetail.setSupportUsers(travelNotePhoto.getSupportUsers());
		travelNotePhotoDetail.setScenicId(travelNotePhoto.getScenicId());
		travelNotePhotoDetail.setScenicName(travelNotePhoto.getScenicName());
		travelNotePhotoDetail.setTravelNotePhotoId(travelNotePhoto.getTravelNotePhotoId());
        travelNotePhotoDetail.setTribalMessages(travelNotePhoto.getTribalMessages());
		return travelNotePhotoDetail;
	}



	@Override
	public void supportInterceptor(List<String> hasPermissionUsers) {
		this.getSupportUsers().retainAll(hasPermissionUsers);
		
		this.setSupportCount(this.getSupportUsers().size());
		
	}

	@Override
	public void collectInterceptor(List<String> collectList) {
		
		
	}

	@Override
	public void userNameInterceptor(List<FriendRelation> friendRelations) {
	
		
	}
	
	
}
